<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datepicker\DatePicker;
/* @var $this yii\web\View */
/* @var $model app\models\WmActive */
/* @var $form yii\widgets\ActiveForm */
$pid = Yii::$app->request->get('pid');
$model->times = empty($model->times)?date("Y-m-d"):$model->times;

if(Yii::$app->request->get('times')){
    $model->times = Yii::$app->request->get('times');
}
?>

<div class="wm-active-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'id')->textInput()->label(false)->hiddenInput() ?>
    <?= $form->field($model, 'pid')->textInput()->label(false)->hiddenInput(['value'=>$pid]) ?>
<!--    --><?php //DatePicker::widget([
//        'model' => $model,
//        'attribute' => 'times',
//        'language'=>'zh-CN',
//        'template' => '{addon}{input}',
//        'clientOptions' => [
//            'autoclose' => true,
//            'format' => 'yyyy-m-dd'
//        ]
//    ]);?>



    <?= $form->field($model, 'times')->textInput(['readonly'=>true]) ?>
    <?= $form->field($model, 'num')->textInput() ?>


    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
